<template>
    <div>
        <home-header></home-header>
        <home-swiper :list="swiperList"></home-swiper>
        <home-like></home-like>
        <home-recommend></home-recommend>
        <home-weekend></home-weekend>
        <home-nav></home-nav>
        <home-footer></home-footer>
    </div>
</template>

<script>
    import 'styles/reset.css'
    import 'styles/border.css'
    import HomeHeader from './components/Header'
    import HomeSwiper from './components/Swiper'
    import HomeLike from './components/Like'
    import HomeNav from './components/Nav'
    import HomeRecommend from './components/Recommend'
    import HomeWeekend from './components/Weekend'
    import HomeFooter from './components/Footer'
    import axios from 'axios'
    export default {
        name: 'Home',
        components: {
            HomeHeader,
            HomeSwiper,
            HomeLike,
            HomeNav,
            HomeRecommend,
            HomeWeekend,
            HomeFooter
        },
        data() {
          return {
              city: '',
              swiperList: []
          }
        },
        methods: {
          getHomeInfo() {
              axios.get('')
                  .then(this.getHomeInfoSucc)
          },
          getHomeInfoSucc(res){
              res = res.data
              if(res.ret&&res.data){
                  const data = res.data
                  this.city = data.city
                  this.swiperList = data.swiperList
              }
          }
        },
        mounted() {
            this.getHomeInfo()
        }
    }
</script>

<style scoped>

</style>
